DRAFT: An operational semantics for C/C++11 concurrency

نویسندگان

  • Kyndylan Nienhuis
  • Kayvan Memarian
  • Peter Sewell
چکیده

The C/C++11 concurrency model balances two goals: it is relaxed enough to be efficiently implementable and (leaving aside the “thin-air” problem) it is strong enough to give useful guarantees to programmers. It is mathematically precise and has been used in verification research and compiler testing. However, the model is expressed in an axiomatic style, as predicates on complete candidate executions. This suffices for computing the set of allowed executions of a small litmus test, but it does not directly support the incremental construction of executions of larger programs. It is also at odds with conventional operational semantics, as used implicitly in the rest of the C/C++ standards. Our main contribution is the development of an operational model for C/C++11 concurrency. This covers all the features of the previous formalised axiomatic model, and we have a mechanised proof that the two are equivalent, in Isabelle/HOL. We also discuss the issues and remaining challenges involved in integrating this semantics with an operational semantics for sequential C (described elsewhere). Doing this uncovered several new aspects of the C/C++11 model: we show that one cannot build an equivalent operational model that simply follows program order, SC order, or the synchronises-with order. The first negative result is forced by hardware-observable behaviour, but the latter two are not, and so might be ameliorated by changing C/C++11. More generally, we hope that this work, with its focus on incremental construction of executions, will inform the future design of new concurrency models.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Operational Aspects of C/C++ Concurrency

Relaxed memory models define the behavior of concurrent programs, executed on modern multiprocessors. Existing semantics for modelling relaxed concurrency in C/C++ adopt the axiomatic style, defining program executions via orders between read/write events. This representation of executions poses challenges for employing such semantics for testing, debugging and symbolic execution of programs. W...

متن کامل

The Problem of Programming Language Concurrency Semantics

Despite decades of research, we do not have a satisfactory concurrency semantics for any general-purpose programming language that aims to support concurrent systems code. The Java Memory Model has been shown to be unsound with respect to standard compiler optimisations, while the C/C++11 model is too weak, admitting undesirable thin-air executions. Our goal in this paper is to articulate this ...

متن کامل

An Introduction to PSFd

PSFd (Process Specification Formalism Draft) is a Formal Description Technique developed for specifying concurrent systems. PSFd supports the modular construction of specifications and parameterization of modules. As semantics for PSFd a combination of initial algebra semantics and operational semantics for concurrent processes is used. This report is intended to give a brief introduction to th...

متن کامل

Concurrency and communication in Delta Prolog

We describe and exemplify the logic programming language Delta Prolog, an extension to Prolog to include AND-concurrency and interprocess communication. Besides its declarative semantics, its operational semantics, comprising distributed backtracking, is especially emphasized. The extension is obtained, at the language level, by introducing three additional goal types: splits, events, and choic...

متن کامل

Oracle Semantics

We define a Concurrent Separation Logic with first-class locks and threads for the C language, and prove its soundness in Coq with respect to a compilable operataional semantics. We define the language Concurrent C minor, an extension of the C minor language of Leroy. C minor was designed as the highest-level intermediate language in the CompCert certified ANSI C compiler, and we add to it lock...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2015